﻿<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
    <!--_meta 作为公共模版分离出去-->
    <% layout("/common/_meta.html",{title:"商户管理"}){} %>
    <!--_meta 作为公共模版分离出去-->
    <%
    var formId = "DepartmentPageForm";
    var isAddBtn = satoken.hasPermission("department:add");
    var isUpdateBtn = satoken.hasPermission("department:update");
    var isDeleteBtn = satoken.hasPermission("department:delete");
    %>
</head>
<body>
<div class="wap-container">
    <nav class="breadcrumb" style="background-color:#fff;padding: 0 24px">首页<span class="c-gray en">/</span>商家管理<span class="c-gray en">/</span>商户管理<a class="btn btn-success radius f-r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a></nav>
    <article class="Hui-admin-content clearfix">
        <form action="${ctxPath}/department/page" method="get" class="form form-horizontal" id="${formId}">
            <div class="panel">
                <div class="panel-body">
                    <div class="text-c">
                        <input type="hidden" name="page" id="page" value="${data.page}">
                        <input type="text" class="input-text" style="width:250px" placeholder="商户名称/简介" id="key" name="key" value="${key!}">
                        <button type="submit" class="btn btn-success"><i class="Hui-iconfont">&#xe665;</i> 查询</button>
                    </div>
                </div>
            </div>
            <div class="panel mt-20">
                <div class="panel-body">
                    <div class="clearfix">
                        <span class="f-l">
                            <%if(isAddBtn){%>
                            <button onclick="layer_show('添加商户','${ctxPath}/department/addForm')" class="btn btn-primary radius" type="button"><i class="Hui-iconfont">&#xe600;</i> 添加商户</button>
                            <%}%>
                        </span>
                        <span class="f-r">
                        <span class="r">
                            共有数据：<strong>${data.totalRow}</strong> 条，每页显示
                            <span class="select-box inline">
                                <select name="size" id="pageCountSelect" class="form-control select" onchange="submitForm('${formId}');">
                                    <option value="20" <%if(data.pageSize == 20){%>selected <%}%>>20</option>
                                    <option value="50" <%if(data.pageSize == 50){%>selected <%}%>>50</option>
                                    <option value="100" <%if(data.pageSize == 100){%>selected <%}%>>100</option>
                                </select>
                            </span>
                        </span>
                    </span>
                    </div>
                    <div class="mt-20 clearfix">
                        <table class="table table-border table-bordered table-bg table-hover table-striped">
                            <thead>
                            <tr class="text-c">
                                <th>商户编号</th>
                                <th>商户名称</th>
                                <th>简介</th>
                                <th>招牌</th>
                                <th>状态</th>
                                <th>创建时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <%for(department in data.list){%>
                            <tr class="text-c">
                                <td>${department.id}</td>
                                <td>${department.name}</td>
                                <td>${department.description}</td>
                                <td><img src="${department.logo}" width="120px" height="90px;"></td>
                                <td>${decode(department.isDisable,true,'停用',false,'正常','')}</td>
                                <td>${department.createTime,"yyyy-MM-dd"}</td>
                                <td>
                                    <%if(isUpdateBtn){%>
                                    <button onclick="layer_show('修改商户','${ctxPath}/department/updateForm?id=${department.id}')" class="btn btn-secondary-outline size-MINI radius" type="button">修改</button>
                                    <%}%>
                                    <%if(isDeleteBtn){%>
                                    <button onclick="layer_confirm('确认删除商户？','${ctxPath}/department/delete?id=${department.id}')" class="btn btn-danger-outline size-MINI radius" type="button">删除</button>
                                    <%}%>
                                </td>
                            </tr>
                            <%}%>
                            </tbody>
                        </table>
                        <div id="pageNav" class="pageNav"></div>
                    </div>
                </div>
            </div>
        </form>
    </article>
</div>

<!--_footer 作为公共模版分离出去-->
<% layout("/common/_footer.html"){} %>
<!--/_footer 作为公共模版分离出去-->
<script type="text/javascript">
    $(function () {
        page(${data.totalPage},${data.page},"${formId}");
        // 操作提示
        var code = $("#code").val();
        var msg = $("#msg").val();
        if (msg.length > 0) {
            layer_msg(code, msg);
        }
    });
</script>
</body>
</html>
